<template>
    <el-select v-model="gender" placeholder="请选择性别" :style="{width: '100%'}" v-bind="$attrs" v-on="$listeners">
        <el-option v-for="(item, index) in genderOptions" :key="index" :label="item.label"
                   :value="item.value"></el-option>
    </el-select>
</template>
<script>
    export default {
        name:"GenderFormItem",
        props:["value"],
        data(){
            return{
                genderOptions: [{
                    "label": "男",
                    "value": 1
                }, {
                    "label": "女",
                    "value": 2
                }, {
                    "label": "未知",
                    "value": 0
                }],
            }
        },
        computed:{
            gender:{
                get(){
                    return this.value
                },
                set(v){
                    this.$emit("input",v)
                }
            }
        }
    }
</script>